import django_filters

from apps.project.models import ProjectQuotaModel, ProjectMaintainModel, ProjectDevelopModel


class ProjectQuotaFilters(django_filters.rest_framework.FilterSet):
    id = django_filters.CharFilter(lookup_expr='exact')
    quote_no = django_filters.CharFilter(field_name='quote_no', lookup_expr='contains')
    quote_wfno = django_filters.CharFilter(field_name='quote_wfno', lookup_expr='contains')
    quote_date = django_filters.DateFilter(field_name='quote_date', lookup_expr='gte')
    quote_content = django_filters.CharFilter(field_name='quote_content', lookup_expr='contains')
    receive_date = django_filters.DateFilter(field_name='receive_date', lookup_expr='gte')
    quote_type = django_filters.CharFilter(field_name='quote_type', lookup_expr='exact')

    class Meta:
        model = ProjectQuotaModel
        fields = '__all__'


class ProjectMaintainFilters(django_filters.rest_framework.FilterSet):
    project_name = django_filters.CharFilter(field_name='project_name', lookup_expr='contains')
    project_status = django_filters.CharFilter(field_name='project_status', lookup_expr='exact')
    order_no = django_filters.CharFilter(field_name='order_no', lookup_expr='contains')
    sales_date = django_filters.DateFilter(field_name='sales_date', lookup_expr='gte')

    class Meta:
        model = ProjectMaintainModel
        fields = '__all__'



class ProjectDevelopFilters(django_filters.rest_framework.FilterSet):
    project_name = django_filters.CharFilter(field_name='project_name', lookup_expr='contains')
    project_status = django_filters.CharFilter(field_name='project_status', lookup_expr='exact')
    order_no = django_filters.CharFilter(field_name='order_no', lookup_expr='contains')
    sales_date = django_filters.DateFilter(field_name='sales_date', lookup_expr='gte')

    class Meta:
        model = ProjectDevelopModel
        fields = '__all__'
